package com.xk857.article.controller.pub;


import com.xk857.article.service.ICategoryService;
import com.xk857.entities.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author CV大魔王
 * @Description 文章模块 - 控制层
 * @date 2021/2/21 14:35
 */
@Api(value = "模块管理接口(公共)", tags = "模块管理接口(公共)")
@RestController
@RequestMapping("/pub/category")
public class PubCategoryController {

    @Autowired
    private ICategoryService categoryService;


    @ApiOperation("获取所有正常状态的模块接口")
    @GetMapping("/list")
    public List<Category> list() {
        return categoryService.findAllNormal();
    }

    @ApiOperation("查询正常状态的模块及模块下的所有知识点接口")
    @GetMapping("/label/list")
    public List<Category> findCategoryAndLabel() {
        return categoryService.findCategoryAndLabel();
    }

}
